import json

from app.api.generate.utils.generate_queue.message_result_proccess import save_generate_image_result, set_server_online, save_generate_text_result


def msg_process(topic, data):
    data = json.loads(data)
    # print(topic, data)
    # print(topic,)
    if topic == "/online":
        set_server_online(data)
    elif topic == "/image_result":
        save_generate_image_result(data)
    elif topic == "/text_result":
        save_generate_text_result(data)
